﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Lawyer.Web.Admin
{
    public partial class admin_userdetail : System.Web.UI.Page
    {
        public string strid = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
                {
                    strid = Request.Params["id"];
                    string UserID = strid;
                    ShowInfo(UserID);
                }
            }
        }

        private void ShowInfo(string UserID)
        {
            Lawyer.BLL.UserInfo bll = new Lawyer.BLL.UserInfo();
            Lawyer.Model.UserInfo model = bll.GetModelFromUserID(UserID);
            if (model == null) model = new Lawyer.Model.UserInfo();
            this.lblUserID.Text = model.UserID;
            this.lblUserName.Text = model.UserName;
            this.lblType.Text = model.Type == 1 ? "Admin" : "Case Worker";//model.Type.ToString();
            this.lblFullName.Text = model.FullName;
            this.lblEmail.Text = model.Email;
            this.lblSex.Text = model.Sex;
            this.lblBirthday.Text = model.Birthday.ToString();
            this.lblCity.Text = model.City;
            this.lblTelphone.Text = model.Telphone;
            this.lblFax.Text = model.Fax;
            this.lblAddress.Text = model.Address;

        }
    }
}
